<template>
    <div id="myCharts"></div>
</template>

<script>
import { defineComponent, onMounted, getCurrentInstance, nextTick } from 'vue'
import { supplyAndMarketing } from '@/echarts/home/index.js'

export default defineComponent({
    setup() {
        const { proxy } = getCurrentInstance()
        onMounted(() => {
            nextTick(() => {
                getMarketingBar()
            })
        })

        //柱状图
        const getMarketingBar = () => {
            let myChart = proxy.$echarts.init(document.getElementById('myCharts'))
            myChart.setOption(supplyAndMarketing)
        }
    },
})
</script>

<style lang="scss" scoped>
#myCharts {
    width: 300px;
    height: 300px;
}
</style>
